/* eslint-disable no-unused-vars */
import React, { memo, useCallback } from "react";
import {
  DndContext,
  DragOverlay,
  useDraggable,
  useDroppable,
} from "@dnd-kit/core";
import { Input } from "antd";
import IconFont from "@/components/IconFont";
import config from "@/layouts/config";
import { ProForm, ProFormText } from "@ant-design/pro-components";

function FormDom({ control }) {
  const { name, type, label } = control;

  const getFormItem = useCallback(() => {
    let controldom = null;
    switch (type) {
      case "input":
        // const formprops = _.pick(control, ['a', 'c']);
        controldom = <ProFormText {...control} />;
        break;

      case "spacer":
        controldom = <div className="spacer" {...control} />;
        break;
      default:
        break;
    }
    return controldom;
  }, [control]);

  return getFormItem();
}

export default memo(FormDom);
